package com.maserb.monitor.repository;

import com.maserb.monitor.entity.JwOrgEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface JwOrgRepository extends JpaSpecificationExecutor<JwOrgEntity>
        , PagingAndSortingRepository<JwOrgEntity, String> {

    List<JwOrgEntity> findByName(String name);

    List<JwOrgEntity> findByTypeOrderByTreeLevel(String type);

    List<JwOrgEntity> findByTreeLevel(int treeLevel);

    JwOrgEntity findFirstByDid(Long did);
}